function factorial(num) {
	var res = 1;
	for(var i = 1 ; i <= num ; i++){
		res *= i; 
	}
	return res;
}
var result = factorial(5);
console.info(result);
alert(5+'的阶乘是：'+result);